package com.example.demo.service.impl;

import com.example.demo.dao.ShopcartDao;
import com.example.demo.pojo.CommodityList;
import com.example.demo.pojo.Shopcart;
import com.example.demo.service.ShopCartService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service("shopCartService")
public class ShopCartServiceImpl implements ShopCartService {
    @Resource(name="shopcartDao")
    private ShopcartDao shopcartDao;
    @Override
    public int deleteByPrimaryKey(Integer shopcartid) {
        return shopcartDao.deleteByPrimaryKey(shopcartid);
    }

    @Override
    public int insert(Shopcart record) {
        return shopcartDao.insert(record);
    }

    @Override
    public int insertSelective(Shopcart record) {
        return shopcartDao.insertSelective(record);
    }

    @Override
    public Shopcart selectByPrimaryKey(Integer shopcartid) {
        return shopcartDao.selectByPrimaryKey(shopcartid);
    }

    @Override
    public int updateByPrimaryKeySelective(Shopcart record) {
        return shopcartDao.updateByPrimaryKeySelective(record);
    }

    @Override
    public int updateByPrimaryKey(Shopcart record) {
        return shopcartDao.updateByPrimaryKey(record);
    }

    @Override
    public List<Shopcart> getShopId(int shopId) {
        return shopcartDao.getShopId(shopId);
    }

    @Override
    public CommodityList getCommId(int commId) {
        return shopcartDao.getCommId(commId);
    }

    @Override
    public int delShoppingCart(int shopId) {
        return shopcartDao.delShoppingCart(shopId);
    }
}
